<md-dialog aria-label="dialog">
    <div ng-if="publicInfo.status === 'loading'" layout="row" layout-align="center center" layout-margin layout-padding>
        <md-progress-circular md-mode="indeterminate" class="md-accent"></md-progress-circular>
    </div>
    <md-dialog-content ng-if="publicInfo.status !== 'loading'">
        <div class="md-dialog-content">
            <div layout="row" layout-align="center center" ng-if="publicInfo.status === 'show'">
                <form name="passwordForm">
                    <md-input-container class="md-block">
                        <label translate>密码</label>
                        <input type="text" required name="password" ng-model="publicInfo.password">
                        <div ng-messages="passwordForm.password.$error">
                            <div ng-message="required" translate>密码不能为空</div>
                        </div>
                    </md-input-container>
                </form>
            </div>
            <div ng-if="publicInfo.status === 'show'">{{ '注意：' | translate }}<br>{{ '此处修改的密码为Shadowsocks的密码' | translate }}</div>
            <div layout="column" layout-align="center center" ng-if="publicInfo.status === 'success'">
                <div style="margin-bottom: 20px;" translate>修改密码成功</div>
            </div>
            <div layout="column" layout-align="center center" ng-if="publicInfo.status === 'error'">
                <div style="margin-bottom: 20px;" translate>修改密码失败</div>
            </div>
        </div>
    </md-dialog-content>
    <md-dialog-actions layout="row" layout-align="center center" ng-if="publicInfo.status !== 'loading'">
        <md-button class="md-primary" ng-click="publicInfo.close()" ng-if="publicInfo.status === 'show'">
            {{ '取消' | translate }}
        </md-button>
        <md-button class="md-primary" ng-click="publicInfo.changePassword()" ng-if="publicInfo.status === 'show'" ng-disabled="publicInfo.password.length < 6">
            {{ '确定' | translate }}
        </md-button>
        <md-button class="md-primary" ng-click="publicInfo.close()" ng-if="publicInfo.status === 'success' || publicInfo.status === 'error'">
            {{ '确定' | translate }}
        </md-button>
    </md-dialog-actions>
</md-dialog>
